\section{ec\+\_\+fsm\+\_\+foe Struct Reference}
\label{structec__fsm__foe}\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}


Finite state machines for the C\+A\+Nopen-\/over-\/\+Ether\+C\+AT protocol.  


\subsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
\textbf{ ec\+\_\+slave\+\_\+t} $\ast$ \textbf{ slave}
\begin{DoxyCompactList}\small\item\em Slave the F\+SM runs on. \end{DoxyCompactList}\item 
\mbox{\label{structec__fsm__foe_a265053a6c277b9bf66c2a28489385d13}} 
unsigned int \textbf{ retries}
\begin{DoxyCompactList}\small\item\em Retries upon datagram timeout. \end{DoxyCompactList}\item 
void($\ast$ \textbf{ state} )(\textbf{ ec\+\_\+fsm\+\_\+foe\+\_\+t} $\ast$, \textbf{ ec\+\_\+datagram\+\_\+t} $\ast$)
\begin{DoxyCompactList}\small\item\em FoE state function. \end{DoxyCompactList}\item 
\textbf{ ec\+\_\+datagram\+\_\+t} $\ast$ \textbf{ datagram}
\begin{DoxyCompactList}\small\item\em Datagram used in previous step. \end{DoxyCompactList}\item 
unsigned long \textbf{ jiffies\+\_\+start}
\begin{DoxyCompactList}\small\item\em FoE timestamp. \end{DoxyCompactList}\item 
uint8\+\_\+t \textbf{ subindex}
\begin{DoxyCompactList}\small\item\em Current subindex. \end{DoxyCompactList}\item 
\textbf{ ec\+\_\+foe\+\_\+request\+\_\+t} $\ast$ \textbf{ request}
\begin{DoxyCompactList}\small\item\em FoE request. \end{DoxyCompactList}\item 
uint8\+\_\+t \textbf{ toggle}
\begin{DoxyCompactList}\small\item\em Toggle bit for segment commands. \end{DoxyCompactList}\item 
uint8\+\_\+t $\ast$ \textbf{ tx\+\_\+buffer}
\begin{DoxyCompactList}\small\item\em Buffer with data to transmit. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ tx\+\_\+buffer\+\_\+size}
\begin{DoxyCompactList}\small\item\em Size of data to transmit. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ tx\+\_\+buffer\+\_\+offset}
\begin{DoxyCompactList}\small\item\em Offset of data to tranmit next. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ tx\+\_\+last\+\_\+packet}
\begin{DoxyCompactList}\small\item\em Current packet is last one to send. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ tx\+\_\+packet\+\_\+no}
\begin{DoxyCompactList}\small\item\em FoE packet number. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ tx\+\_\+current\+\_\+size}
\begin{DoxyCompactList}\small\item\em Size of current packet to send. \end{DoxyCompactList}\item 
uint8\+\_\+t $\ast$ \textbf{ tx\+\_\+filename}
\begin{DoxyCompactList}\small\item\em Name of file to transmit. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ tx\+\_\+filename\+\_\+len}
\begin{DoxyCompactList}\small\item\em Lenth of transmit file name. \end{DoxyCompactList}\item 
uint8\+\_\+t $\ast$ \textbf{ rx\+\_\+buffer}
\begin{DoxyCompactList}\small\item\em Buffer for received data. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ rx\+\_\+buffer\+\_\+size}
\begin{DoxyCompactList}\small\item\em Size of receive buffer. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ rx\+\_\+buffer\+\_\+offset}
\begin{DoxyCompactList}\small\item\em Offset in receive buffer. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ rx\+\_\+expected\+\_\+packet\+\_\+no}
\begin{DoxyCompactList}\small\item\em Expected receive packet number. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ rx\+\_\+last\+\_\+packet}
\begin{DoxyCompactList}\small\item\em Current packet is the last to receive. \end{DoxyCompactList}\item 
uint8\+\_\+t $\ast$ \textbf{ rx\+\_\+filename}
\begin{DoxyCompactList}\small\item\em Name of the file to receive. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ rx\+\_\+filename\+\_\+len}
\begin{DoxyCompactList}\small\item\em Length of the receive file name. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Finite state machines for the C\+A\+Nopen-\/over-\/\+Ether\+C\+AT protocol. 

Definition at line 53 of file fsm\+\_\+foe.\+h.



\subsection{Field Documentation}
\mbox{\label{structec__fsm__foe_ae4d76e0ce8fa63d0dcd8b843933a49af}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!slave@{slave}}
\index{slave@{slave}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{slave}
{\footnotesize\ttfamily \textbf{ ec\+\_\+slave\+\_\+t}$\ast$ ec\+\_\+fsm\+\_\+foe\+::slave}



Slave the F\+SM runs on. 



Definition at line 54 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_afb4f3be7845e6bd7c405f4e1c3908d45}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!state@{state}}
\index{state@{state}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{state}
{\footnotesize\ttfamily void($\ast$ ec\+\_\+fsm\+\_\+foe\+::state) (\textbf{ ec\+\_\+fsm\+\_\+foe\+\_\+t} $\ast$, \textbf{ ec\+\_\+datagram\+\_\+t} $\ast$)}



FoE state function. 



Definition at line 57 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a19c8a77b4f92a3813f23262c3c89dbfc}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!datagram@{datagram}}
\index{datagram@{datagram}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{datagram}
{\footnotesize\ttfamily \textbf{ ec\+\_\+datagram\+\_\+t}$\ast$ ec\+\_\+fsm\+\_\+foe\+::datagram}



Datagram used in previous step. 



Definition at line 58 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a42f6c78ac58392cab6a186e5dd43a992}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!jiffies\+\_\+start@{jiffies\+\_\+start}}
\index{jiffies\+\_\+start@{jiffies\+\_\+start}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{jiffies\+\_\+start}
{\footnotesize\ttfamily unsigned long ec\+\_\+fsm\+\_\+foe\+::jiffies\+\_\+start}



FoE timestamp. 



Definition at line 59 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a14293bb60b8829e96d5463d412dff4e0}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!subindex@{subindex}}
\index{subindex@{subindex}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{subindex}
{\footnotesize\ttfamily uint8\+\_\+t ec\+\_\+fsm\+\_\+foe\+::subindex}



Current subindex. 



Definition at line 60 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a000c08fd63b07a083d61a781b68529ee}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!request@{request}}
\index{request@{request}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{request}
{\footnotesize\ttfamily \textbf{ ec\+\_\+foe\+\_\+request\+\_\+t}$\ast$ ec\+\_\+fsm\+\_\+foe\+::request}



FoE request. 



Definition at line 61 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_ae3c3f1d7a1a8637434f33e1de9fb0c01}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!toggle@{toggle}}
\index{toggle@{toggle}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{toggle}
{\footnotesize\ttfamily uint8\+\_\+t ec\+\_\+fsm\+\_\+foe\+::toggle}



Toggle bit for segment commands. 



Definition at line 62 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_afe4370bcebc74b342e51dc6ec7c167bd}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!tx\+\_\+buffer@{tx\+\_\+buffer}}
\index{tx\+\_\+buffer@{tx\+\_\+buffer}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{tx\+\_\+buffer}
{\footnotesize\ttfamily uint8\+\_\+t$\ast$ ec\+\_\+fsm\+\_\+foe\+::tx\+\_\+buffer}



Buffer with data to transmit. 



Definition at line 64 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a25f7057a98c25d28cb089b7268cb415d}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!tx\+\_\+buffer\+\_\+size@{tx\+\_\+buffer\+\_\+size}}
\index{tx\+\_\+buffer\+\_\+size@{tx\+\_\+buffer\+\_\+size}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{tx\+\_\+buffer\+\_\+size}
{\footnotesize\ttfamily uint32\+\_\+t ec\+\_\+fsm\+\_\+foe\+::tx\+\_\+buffer\+\_\+size}



Size of data to transmit. 



Definition at line 65 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_af01ef503eebc97048e1eb67bf5fed201}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!tx\+\_\+buffer\+\_\+offset@{tx\+\_\+buffer\+\_\+offset}}
\index{tx\+\_\+buffer\+\_\+offset@{tx\+\_\+buffer\+\_\+offset}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{tx\+\_\+buffer\+\_\+offset}
{\footnotesize\ttfamily uint32\+\_\+t ec\+\_\+fsm\+\_\+foe\+::tx\+\_\+buffer\+\_\+offset}



Offset of data to tranmit next. 



Definition at line 66 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_aa4137f668dc4033561be82316a117d8e}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!tx\+\_\+last\+\_\+packet@{tx\+\_\+last\+\_\+packet}}
\index{tx\+\_\+last\+\_\+packet@{tx\+\_\+last\+\_\+packet}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{tx\+\_\+last\+\_\+packet}
{\footnotesize\ttfamily uint32\+\_\+t ec\+\_\+fsm\+\_\+foe\+::tx\+\_\+last\+\_\+packet}



Current packet is last one to send. 



Definition at line 67 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a80ee572b78695906bfe1df61cda4bb4a}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!tx\+\_\+packet\+\_\+no@{tx\+\_\+packet\+\_\+no}}
\index{tx\+\_\+packet\+\_\+no@{tx\+\_\+packet\+\_\+no}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{tx\+\_\+packet\+\_\+no}
{\footnotesize\ttfamily uint32\+\_\+t ec\+\_\+fsm\+\_\+foe\+::tx\+\_\+packet\+\_\+no}



FoE packet number. 



Definition at line 68 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_afca679da6083ed8c5dd4559941938527}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!tx\+\_\+current\+\_\+size@{tx\+\_\+current\+\_\+size}}
\index{tx\+\_\+current\+\_\+size@{tx\+\_\+current\+\_\+size}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{tx\+\_\+current\+\_\+size}
{\footnotesize\ttfamily uint32\+\_\+t ec\+\_\+fsm\+\_\+foe\+::tx\+\_\+current\+\_\+size}



Size of current packet to send. 



Definition at line 69 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a9861ec153889855a1fa74c1bada87865}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!tx\+\_\+filename@{tx\+\_\+filename}}
\index{tx\+\_\+filename@{tx\+\_\+filename}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{tx\+\_\+filename}
{\footnotesize\ttfamily uint8\+\_\+t$\ast$ ec\+\_\+fsm\+\_\+foe\+::tx\+\_\+filename}



Name of file to transmit. 



Definition at line 70 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a752483ab511b3c67efe4e1e111d6693f}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!tx\+\_\+filename\+\_\+len@{tx\+\_\+filename\+\_\+len}}
\index{tx\+\_\+filename\+\_\+len@{tx\+\_\+filename\+\_\+len}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{tx\+\_\+filename\+\_\+len}
{\footnotesize\ttfamily uint32\+\_\+t ec\+\_\+fsm\+\_\+foe\+::tx\+\_\+filename\+\_\+len}



Lenth of transmit file name. 



Definition at line 71 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a2141eab8b9b4821e6714c4873114d93e}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!rx\+\_\+buffer@{rx\+\_\+buffer}}
\index{rx\+\_\+buffer@{rx\+\_\+buffer}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{rx\+\_\+buffer}
{\footnotesize\ttfamily uint8\+\_\+t$\ast$ ec\+\_\+fsm\+\_\+foe\+::rx\+\_\+buffer}



Buffer for received data. 



Definition at line 73 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_ad44c7d17687802d770d8c455caa2e490}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!rx\+\_\+buffer\+\_\+size@{rx\+\_\+buffer\+\_\+size}}
\index{rx\+\_\+buffer\+\_\+size@{rx\+\_\+buffer\+\_\+size}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{rx\+\_\+buffer\+\_\+size}
{\footnotesize\ttfamily uint32\+\_\+t ec\+\_\+fsm\+\_\+foe\+::rx\+\_\+buffer\+\_\+size}



Size of receive buffer. 



Definition at line 74 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a92ba79d9ab8dfcb3a57ff98e05450a85}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!rx\+\_\+buffer\+\_\+offset@{rx\+\_\+buffer\+\_\+offset}}
\index{rx\+\_\+buffer\+\_\+offset@{rx\+\_\+buffer\+\_\+offset}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{rx\+\_\+buffer\+\_\+offset}
{\footnotesize\ttfamily uint32\+\_\+t ec\+\_\+fsm\+\_\+foe\+::rx\+\_\+buffer\+\_\+offset}



Offset in receive buffer. 



Definition at line 75 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a6497d12beaa6dba428a4014579a5515f}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!rx\+\_\+expected\+\_\+packet\+\_\+no@{rx\+\_\+expected\+\_\+packet\+\_\+no}}
\index{rx\+\_\+expected\+\_\+packet\+\_\+no@{rx\+\_\+expected\+\_\+packet\+\_\+no}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{rx\+\_\+expected\+\_\+packet\+\_\+no}
{\footnotesize\ttfamily uint32\+\_\+t ec\+\_\+fsm\+\_\+foe\+::rx\+\_\+expected\+\_\+packet\+\_\+no}



Expected receive packet number. 



Definition at line 76 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_a1851f47e360be36fa979e219f36da5d0}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!rx\+\_\+last\+\_\+packet@{rx\+\_\+last\+\_\+packet}}
\index{rx\+\_\+last\+\_\+packet@{rx\+\_\+last\+\_\+packet}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{rx\+\_\+last\+\_\+packet}
{\footnotesize\ttfamily uint32\+\_\+t ec\+\_\+fsm\+\_\+foe\+::rx\+\_\+last\+\_\+packet}



Current packet is the last to receive. 



Definition at line 77 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_af0315313d092bab948ce47c2114dc870}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!rx\+\_\+filename@{rx\+\_\+filename}}
\index{rx\+\_\+filename@{rx\+\_\+filename}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{rx\+\_\+filename}
{\footnotesize\ttfamily uint8\+\_\+t$\ast$ ec\+\_\+fsm\+\_\+foe\+::rx\+\_\+filename}



Name of the file to receive. 



Definition at line 78 of file fsm\+\_\+foe.\+h.

\mbox{\label{structec__fsm__foe_ab355fc6657db6b9c8c63fee2ec3a4e91}} 
\index{ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}!rx\+\_\+filename\+\_\+len@{rx\+\_\+filename\+\_\+len}}
\index{rx\+\_\+filename\+\_\+len@{rx\+\_\+filename\+\_\+len}!ec\+\_\+fsm\+\_\+foe@{ec\+\_\+fsm\+\_\+foe}}
\subsubsection{rx\+\_\+filename\+\_\+len}
{\footnotesize\ttfamily uint32\+\_\+t ec\+\_\+fsm\+\_\+foe\+::rx\+\_\+filename\+\_\+len}



Length of the receive file name. 



Definition at line 79 of file fsm\+\_\+foe.\+h.

